﻿

using System;
using System.ServiceModel;

using DemoService.Calculator;

namespace DemoHost
{
    class Program
    {
        static void Main(string[] args)
        {

            using (ServiceHost host = new ServiceHost(typeof(Calculator)))
            {

                host.Opened += delegate 
                {
                    Console.WriteLine("Calculator 服务已经启动,状态：" + host.State);
                };
                
                host.Open();

                Console.Read();

            }

        }

    }
}
